using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class ModuleMap : EntityTypeConfiguration<Module>
    {
        public ModuleMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ModName)
                .HasMaxLength(30);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("Module");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.ModName).HasColumnName("ModName");
            this.Property(t => t.PROJECT).HasColumnName("PROJECT");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
        }
    }
}
